{% extends "layouts/base.html" %} {% block title %} Page User {% endblock %}

<!-- Specific Page CSS goes HERE  -->
{% block stylesheets %}{% endblock stylesheets %} {% block content %}
<div class="row">
  <div class="col-md-10 col-sm-12">
    <div class="card">
      <div class="card-header card-header-primary">
        <h4 class="card-title">工单详情</h4>
      </div>
      <div class="card-body">
        <div class="row">
          <div class="col-md-3">
            <label>工单序号</label>
          </div>
          <div class="col-md-9">
            <span>{{task.id}} </span>
          </div>
        </div>
        <div class="row">
          <div class="col-md-3">
            <label>工单标题</label>
          </div>
          <div class="col-md-9">
            <span>{{task.title}} </span>
          </div>
        </div>

        <div class="row">
          <div class="col-md-3">
            <label>工单描述</label>
          </div>
          <div class="col-md-9">
            <span>{{task.description}} </span>
          </div>
        </div>

        <div class="row">
          <div class="col-md-3">
            <label>状态</label>
          </div>
          <div class="col-md-9">
            {% if task.completed %} 已完成 {% else %} 未完成 {% endif %}
          </div>
        </div>

        <div class="row">
          <div class="col-md-3">
            <label>开始时间</label>
          </div>
          <div class="col-md-9">
            {% if task.completed %} 已完成 {% else %} 未完成 {% endif %}
          </div>
        </div>

        <div class="row">
          <div class="col-md-3">
            <label>结束时间</label>
          </div>
          <div class="col-md-9">{{task.finished }}</div>
        </div>

        <div class="row">
          <div class="col-md-3">
            <label>训练数据</label>
          </div>
          <div class="col-md-3">
            <a href="/download_train/{{task.id}}">{{task.train_data_file }}</a>
            <a href="/download_train/{{task.id}}">
              <button class="btn btn-info">下载文件</button>
            </a>
          </div>
        </div>
        <div class="row">
          <div class="col-md-3">
            <label>测试数据</label>
          </div>
          <div class="col-md-9">
            <a href="/download_test/{{task.id}}"
              >{{task.gold_data_file }}</a
            >
            <a href="/download_test/{{task.id}}">
              <button class="btn btn-info">下载文件</button>
            </a>
          </div>
        </div>

        <div class="row">
          <div class="col-md-3">
            <label>测试结果</label>
          </div>
          <div class="col-md-9">
            {% if task.result_data_file%}
            <a href="/download_result/{{task.id}}"
              >{{task.result_data_file }}</a
            >
            <a href="/download_result/{{task.id}}">
              <button class="btn btn-info">下载文件</button>

            </a>
            {% else %}
            <span>无</span>
            {% endif %}
          </div>
        </div>
            <button
              onclick="window.location.href = '/history'"
              type="submit"
              class="btn btn-primary pull-right"
            >
              返回
            </button>

            {% if task.result_data_file%}
            <button
              onclick="window.location.href = '/display/{{task.id}}'"
              class="btn btn-success pull-left"
            >
              结果可视化
            </button>
            {% endif %}
          </div>
        </div>
      </div>
    </div>
    {% endblock content %}

    <!-- Specific Page JS goes HERE  -->
    {% block javascripts %}{% endblock javascripts %}
  </div>
</div>
